package com.app.repository.interfaces;

import com.app.model.main.Focus;

import java.util.List;

public interface FocusMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Focus record);

    int insertSelective(Focus record);

    Focus selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Focus record);

    int updateByPrimaryKey(Focus record);

    /**
     * 查询用户所有的粉丝
     * @param userId 用户id
     * @return
     */
    List<Long> getFansList(long userId);
    /**
     * 查询用户所有的关注
     * @param userId 用户id
     * @return
     */
    List<Long> getFocusList(long userId);

    /**
     * 用户间关注关系查询 1-from关注了to；0-from没有关注to
     */
    int getRelationBetween(Long fromId, Long toId);

    long getFansNumber(long userId);

    long getFocusNumber(long userId);

    List<Long> getFansListASC(long userId, long lastId, int number);

    List<Long> getFansListDESC(long userId, long lastId, int number);

    List<Long> getFocusListASC(long userId, long lastId, int number);

    List<Long> getFocusListDESC(long userId, long lastId, int number);

    Focus selectByParam(long from, long to);
}